package com.ewing.extranal.im;

/**
 * 类/接口注释
 * 
 * @author tansonlam
 * @createDate 2016年4月21日
 * 
 */
import javax.servlet.http.HttpSession;
import javax.websocket.HandshakeResponse;
import javax.websocket.server.HandshakeRequest;
import javax.websocket.server.ServerEndpointConfig;

public class GetHttpSessionConfigurator extends ServerEndpointConfig.Configurator {
    @Override
    public void modifyHandshake(ServerEndpointConfig config, HandshakeRequest request,
            HandshakeResponse response) {
        HttpSession httpSession = (HttpSession) request.getHttpSession();
        if(httpSession!=null)
        config.getUserProperties().put(HttpSession.class.getName(), httpSession);
    }
}
